package com.sinothk.hm.retrofit.interceptor;

import com.sinothk.hm.retrofit.HiRetrofit;
import ohos.hiviewdfx.HiLog;
import okhttp3.Interceptor;
import okhttp3.Request;

import java.io.IOException;

/**
 * <pre>
 *  创建:  梁玉涛 2018/12/25 on 0:00
 *  项目:  RxRetrofitLib
 *  描述:
 *  更新:
 * <pre>
 */
public class DownLoadInterceptor implements Interceptor {

    @Override
    public synchronized okhttp3.Response intercept(Chain chain) throws IOException {
        // 日志打印封装
        String TAG = "RxRetrofitLog";
        HiLog.debug(HiRetrofit.LABEL, "HiRetrofit > ============================================");
        // 请求地址
        Request request = chain.request();
        HiLog.debug(HiRetrofit.LABEL, "HiRetrofit > 地址: " + request.url());
        // 结果
        HiLog.debug(HiRetrofit.LABEL, "HiRetrofit > ============================================");
        return chain.proceed(chain.request());
    }
}
